﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MyMeta;

namespace Liger.Generate
{
    public class ColumnBase
    {
        public string CSharpType { get; set; }


        private IColumn column;

        public string Alias { get { return column.Alias; } }
        public int AutoKeyIncrement { get { return column.AutoKeyIncrement; } }
        public int AutoKeySeed { get { return column.AutoKeyIncrement; } }
        public int CharacterMaxLength { get { return column.AutoKeyIncrement; } }
        public int CharacterOctetLength { get { return column.AutoKeyIncrement; } }
        public string CharacterSetCatalog { get { return column.CharacterSetCatalog; } }
        public string CharacterSetName { get { return column.CharacterSetName; } }
        public string CharacterSetSchema { get { return column.CharacterSetSchema; } }
        public int CompFlags { get { return column.CompFlags; } }
        public int DataType { get { return column.DataType; } }
        public string DataTypeName { get { return column.DataTypeName; } }
        public string DataTypeNameComplete { get { return column.DataTypeNameComplete; } }
        public int DateTimePrecision { get { return column.DateTimePrecision; } }
        public string DbTargetType { get { return column.DbTargetType; } }
        public string Default { get { return column.Default; } }
        public string Description { get { return column.Description; } }
        public string DomainCatalog { get { return column.DomainCatalog; } }
        public string DomainName { get { return column.DomainName; } }
        public string DomainSchema { get { return column.DomainSchema; } }
        public int Flags { get { return column.AutoKeyIncrement; } }
        public bool HasDefault { get { return column.HasDefault; } }
        public bool HasDomain { get { return column.HasDomain; } }
        public bool IsAutoKey { get { return column.IsAutoKey; } }
        public bool IsComputed { get { return column.IsComputed; } }
        public bool IsInForeignKey { get { return column.IsInForeignKey; } }
        public bool IsInPrimaryKey { get { return column.IsInPrimaryKey; } }
        public bool IsNullable { get { return column.IsNullable; } }
        public string LanguageType { get { return column.LanguageType; } }
        public int LCID { get { return column.LCID; } }
        public string Name { get { return column.Name; } }
        public int NumericPrecision { get { return column.NumericPrecision; } }
        public int NumericScale { get { return column.NumericScale; } }
        public int Ordinal { get { return column.Ordinal; } }
        public int PropID { get { return column.PropID; } }
        public int SortID { get { return column.SortID; } }

        public ColumnBase(IColumn column)
        {
            this.column = column;

            this.CSharpType = DbTemplateHepler.GetCSharpType(this);
        }
    }
}